package net.toocruel.iqismart.entity.core;

import net.toocruel.iqismart.entity.rbac.User;
import net.toocruel.iqismart.entity.base.BaseEntity;

import javax.persistence.*;

/**
 * @Description
 * @Auther sty
 * @createTime 2018/5/8 上午11:35
 */
@Entity
public class Message extends BaseEntity {
    private static final long serialVersionUID = 4032303726772009094L;
    @ManyToOne(cascade = CascadeType.DETACH,fetch = FetchType.LAZY,optional = false)
    @JoinColumn(name = "fromUserId")
    private User fromUser;
    @ManyToOne(cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "toUserId")
    private User toUser;

    private String content;
    @Column(name = "`read`")
    private Boolean read = false;
    private Boolean fromDeleted = false;
    private Boolean toDeleted = false;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public User getFromUser() {
        return fromUser;
    }

    public void setFromUser(User fromUser) {
        this.fromUser = fromUser;
    }

    public User getToUser() {
        return toUser;
    }

    public void setToUser(User toUser) {
        this.toUser = toUser;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Boolean getRead() {
        return read;
    }

    public void setRead(Boolean read) {
        this.read = read;
    }

    public Boolean getFromDeleted() {
        return fromDeleted;
    }

    public void setFromDeleted(Boolean fromDeleted) {
        this.fromDeleted = fromDeleted;
    }

    public Boolean getToDeleted() {
        return toDeleted;
    }

    public void setToDeleted(Boolean toDeleted) {
        this.toDeleted = toDeleted;
    }
}
